﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminMaster.Master" AutoEventWireup="true" CodeBehind="Orders.aspx.cs" Inherits="MyWeb.Admins.Orders" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="PageName">Quản lý hóa đơn</div>
    <asp:Panel ID="pnViews" runat="server">
        <div class="Control">
            <ul>
                <li>
                    <asp:LinkButton CssClass="vdelete" ID="lbtDeleteT" runat="server" OnClick="DeleteButton_Click">Xóa</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vrefresh" ID="lbtRefreshT" runat="server" OnClick="RefreshButton_Click">Làm mới</asp:LinkButton></li>
                <li><a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở lại</a> </li>
            </ul>
        </div>
        <asp:DataGrid ID="grdOrders" runat="server" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" 
            CellPadding="3" CellSpacing="1" GridLines="None" Width="100%" 
            onitemcommand="grdOrders_ItemCommand" 
            onpageindexchanged="grdOrders_PageIndexChanged" 
            onitemdatabound="grdOrders_ItemDataBound">
            <Columns>
                <asp:TemplateColumn ItemStyle-CssClass="tdCenter">
                    <HeaderTemplate>
                        <asp:CheckBox ID="chkSelectAll" runat="server" AutoPostBack="False"></asp:CheckBox>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                    <ItemStyle CssClass="tdCenter"></ItemStyle>
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Text">
                    <HeaderTemplate>Tên khách hàng</HeaderTemplate>
                    <ItemTemplate><%#Eval("Name").ToString() %></ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Text">
                    <HeaderTemplate>Ngày sinh</HeaderTemplate>
                    <ItemTemplate> <%#Eval("Birthday").ToString() %></ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Text">
                    <HeaderTemplate>Địa chỉ</HeaderTemplate>
                    <ItemTemplate><%#Eval("Adress").ToString() %></ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                </asp:TemplateColumn >
                <asp:TemplateColumn ItemStyle-CssClass="Text">
                    <HeaderTemplate>Ngày đặt hàng</HeaderTemplate>
                    <ItemTemplate><%#Eval("CreatDate").ToString()%></ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Text">
                    <HeaderTemplate>Ngày giao hàng</HeaderTemplate>
                    <ItemTemplate><%#Eval("DeliveryDate").ToString()%></ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Text">
                    <HeaderTemplate>Trạng thái</HeaderTemplate>
                    <ItemTemplate><%#Status(Eval("Status").ToString())%></ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                </asp:TemplateColumn>
                <asp:TemplateColumn ItemStyle-CssClass="Function">
                    <HeaderTemplate>Chức năng</HeaderTemplate>
                    <ItemTemplate>
                        <asp:ImageButton ID="cmdEdit" runat="server" AlternateText="Xem đơn hàng" CommandName="Edit"
                            CssClass="Edit" ToolTip="Xem đơn hàng" ImageUrl="/App_Themes/Admin/images/edit.png"
                            CommandArgument='<%#Eval("Id")%>' />
                        <asp:ImageButton ID="cmdDelete" runat="server" AlternateText="Xóa" CommandName="Delete"
                            CssClass="Delete" ToolTip="Xóa" ImageUrl="/App_Themes/Admin/images/delete.png"
                            CommandArgument='<%#Eval("Id")%>' OnClientClick="javascript:return confirm('Bạn có muốn xóa?');" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateColumn>
            </Columns>
            <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
            <ItemStyle BackColor="#DEDFDE" ForeColor="Black" />
            <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedItemStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
        </asp:DataGrid>
        <div class="Control">
            <ul>
                <li>
                    <asp:LinkButton CssClass="vdelete" ID="lbtDeleteB" runat="server" OnClick="DeleteButton_Click">Xóa</asp:LinkButton></li>
                <li>
                    <asp:LinkButton CssClass="vrefresh" ID="lbtRefreshB" runat="server" OnClick="RefreshButton_Click">Làm mới</asp:LinkButton></li>
                <li><a class="vback" href="javascript:void(0);" onclick="window.history.go(-1);">Trở lại</a> </li>
            </ul>
        </div>
    </asp:Panel>
    <asp:Panel ID="pnUpdate" runat="server" Visible="false">
        <table class="TableUpdate" border="1">
            <tr>
                <td class="Control">
                    <ul>
                        <li>
                            <asp:LinkButton CssClass="uupdate" ID="lbtUpdateT" runat="server" OnClick="lbtUpdate_Click">Đã giao hàng</asp:LinkButton></li>
                        <li>
                            <asp:LinkButton CssClass="uback" ID="lbtBackT" runat="server" OnClick="Back_Click"
                                CausesValidation="False">Trở về</asp:LinkButton></li>
                    </ul>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="PageName">Thông tin khách hàng<asp:TextBox ID="txtIdCus" runat="server" Visible="False"></asp:TextBox></div>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:DataGrid ID="grdCustormer" runat="server" CssClass="TableView" AutoGenerateColumns="False" ShowHeader="false">
                        <Columns>
                            <asp:TemplateColumn>
                                 <ItemTemplate>
                                    <table border="0">
                                        <tr><th>Họ tên:</th><td><%#Eval("Name").ToString() %></td></tr>
                                        <tr><th>Ngày sinh:</th><td><%#Eval("Birthday").ToString() %></td></tr>
                                        <tr><th>Địa chỉ</th><td><%#Eval("Adress").ToString() %></td></tr>
                                        <tr><th>Điện thoại</th><td><%#Eval("Phone").ToString() %></td></tr>
                                        <tr><th>Email:</th><td><%#Eval("Email").ToString() %></td></tr>
                                    </table>
                                 </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                    </asp:DataGrid>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="PageName">Thông tin người nhận hàng</div>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:DataGrid ID="grdRecipient" runat="server" AutoGenerateColumns="False" ShowHeader="false">
                        <Columns>
                            <asp:TemplateColumn>
                                <ItemTemplate>
                                <table border="0">
                                    <tr><th>Họ tên:</th><td><%#Eval("ReciName").ToString() %></td></tr>
                                    <tr><th>Ngày sinh</th><td><%#Eval("Birthday").ToString() %></td></tr>
                                    <tr><th>Địa chỉ</th><td><%#Eval("Adress").ToString() %></td></tr>
                                    <tr><th>Điện thoại</th><td><%#Eval("Phone").ToString() %></td></tr>
                                    <tr><th>Trạng thái</th><td><%#Eval("Status").ToString() %></td></tr>
                                </table>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                    </asp:DataGrid>
                </td>
            </tr>
            <tr>
                <td class="PageName">Thông tin đơn hàng</td>
            </tr>
            <tr>
                <td class="style1">
                    <asp:DataGrid ID="grdShopcard" runat="server" AutoGenerateColumns="false" Width="100%" CellPadding="10">
                        <Columns>
                            <asp:TemplateColumn>
                                <HeaderTemplate>Sản phẩm</HeaderTemplate>
                                <ItemTemplate>
                                    <%#Tensp(Eval("ProductsId").ToString())%>
                                    <br />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" />
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <HeaderTemplate>Số lượng</HeaderTemplate>
                                <ItemTemplate>
                                    <%#Eval("Quantity").ToString() %>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <HeaderTemplate>Giá bán</HeaderTemplate>
                                <ItemTemplate>
                                    <%#Format_Frice(Eval("Price").ToString())%>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <HeaderTemplate>Thành tiền</HeaderTemplate>
                                <ItemTemplate><%#Format_Frice(Eval("TotalMoney").ToString())%></ItemTemplate>
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:TemplateColumn>
                        </Columns>
                        <HeaderStyle HorizontalAlign="Center" BackColor="#00CCFF" Font-Bold="True" 
                            Font-Overline="False" />
                        <ItemStyle BackColor="#FFCCFF" />
                    </asp:DataGrid>
                    <table width="100%" border="0" cellspacing="0" cellpadding="3" style="background: #E8E8E8;
                        border-collapse: collapse">
                        <tr style="border: 1px solid #FFF; height: 30px">
                            <td align="right" style="border-left: 1px solid #B3B3B3; font-weight: bold">
                                &nbsp;
                            </td>
                            <td style="text-align: right">
                                &nbsp;
                            </td>
                            <td style="border-right: 1px solid #B3B3B3; text-align: right; padding-right: 20px">
                                &nbsp;
                            </td>
                        </tr>
                        <tr style="border: 1px solid #FFF; height: 30px">
                            <td width="57%" align="right" style="border-left: 1px solid #B3B3B3; border-bottom: 1px solid #B3B3B3">
                                <asp:Label ID="lblsum" runat="server" Text="Tổng số tiền" Font-Bold="True"></asp:Label>
                            </td>
                            <td width="3%" style="border-bottom: 1px solid #B3B3B3">
                                &nbsp;
                            </td>
                            <td width="20%" style="border-right: 1px solid #B3B3B3; border-bottom: 1px solid #B3B3B3;
                                padding-right: 20px" align="right">
                                <asp:Label ID="lblsumpay" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="Control">
                    <ul>
                        <li>
                            <asp:LinkButton ID="lbtUpdateB" runat="server" CssClass="uupdate">Đã giao hàng</asp:LinkButton>
                        </li>
                        <li>
                            <asp:LinkButton ID="lbtBackB" runat="server" CausesValidation="False" CssClass="uback" OnClick="Back_Click">Trở về</asp:LinkButton>
                        </li>
                    </ul>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
